﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PDX.ContextManagement
{
    /// <summary>
    /// Attaches functionality to a <see cref="Context"/>
    /// </summary>
    public class ContextAttacher : IAttacher<Context>
    {
        /// <summary>
        /// Attaches functionality to the <see cref="Context"/>
        /// </summary>
        /// <param name="target">The target.</param>
        public void Attach(Context target)
        {
            var locator = Services.Singletons.ServiceProvider;
            var pmFactory = locator.Resolve<IPropertyModelFactory>();
            var resolver = locator.Resolve<IPropertyResolver>();
            var notifierFactory = locator.Resolve<Notification.INotificationManagerFactory>();
            var notifier = notifierFactory.Create(target);

            var propertyModelManager = new PropertyModelManager(target, pmFactory, notifier);

            var declarationManager = new DeclarationManager(target);

            var resolutionManager = new ResolutionManager(target, resolver);
        }
    }
}
